package com.fyy.sentinelrule.controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author fyy
 * @Description
 * @Date 2021/7/15 16:41
 */
@RestController
public class DegradeController {

    @SentinelResource(value = "Test",fallback = "exHandler")
    @RequestMapping("test")
    public String test(){
        return "你好，Sentinel!";
    }

    public String exHandler(){
        return "系统繁忙！";
    }

}
